| Conditions | 1 |
| Total Lines | 5 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import {MigrationInterface, QueryRunner} from "typeorm"; |
||
| 5 | |||
| 6 | public async up(queryRunner: QueryRunner): Promise<void> { |
||
| 7 | await queryRunner.query(`CREATE TYPE "ingestion_state_enum" AS ENUM('init', 'upload_started', 'upload_cancelled', 'upload_finished', 'failed')`); |
||
| 8 | await queryRunner.query(`CREATE TABLE "ingestion" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "state" "ingestion_state_enum" NOT NULL DEFAULT 'init', "schoolId" uuid NOT NULL, CONSTRAINT "PK_c318c071e868a0a37153cabf606" PRIMARY KEY ("id"))`); |
||
| 9 | await queryRunner.query(`ALTER TABLE "ingestion" ADD CONSTRAINT "FK_bedba27d2f82d30b329ca7248f1" FOREIGN KEY ("schoolId") REFERENCES "school"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); |
||
| 10 | } |
||
| 19 |